import 'package:local_coffee/components/hex.dart';
import 'package:local_coffee/components/rgba.dart';
import 'package:flutter/material.dart';
import 'package:local_coffee/components/icon.dart';

class CouponRow extends StatelessWidget {
  
  const CouponRow({
    Key key
  }) : super (key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(top: 15),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.all(Radius.circular(4)),
        color: HEX.hexfff,
      ),
      height: 120,
      padding: EdgeInsets.all(5),
      child: Container(
        alignment: Alignment.center,
        decoration: BoxDecoration(
          border: Border.all(
            color: RGBA.rgbaf2f2f2,
            width: 1
          ),
          borderRadius: BorderRadius.all(Radius.circular(4))
        ),
        child: Stack(
          children: <Widget>[
            Container(
              padding: EdgeInsets.symmetric(vertical: 25),
              child: Row(
                children: <Widget>[
                  Container(
                    width: 85,
                    alignment: Alignment.center,
                    decoration: BoxDecoration(
                      border: Border(
                        right: BorderSide(
                          width: 1,
                          color: RGBA.rgbaf2f2f2
                        )
                      )
                    ),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: <Widget>[
                        Text(
                          '4',
                          style: TextStyle(
                            color: RGBA.rgba94c4ec,
                            fontSize: 34
                          ),
                        ),
                        Text(
                          '.8折',
                          style: TextStyle(
                            color: RGBA.rgba94c4ec,
                            fontSize: 18
                          ),
                        )
                      ],
                    ),
                  ),
                  Expanded(
                    child: Container(
                      padding: EdgeInsets.only(left: 20, right: 15),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: <Widget>[
                          // left
                          Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            mainAxisAlignment: MainAxisAlignment.center,
                            children: <Widget>[
                              Text(
                                '咖啡.果汁',
                                style: TextStyle(
                                  color: RGBA.rgba383838,
                                  fontSize: 16
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 7),
                                child: Text(
                                  '有效期至 2020-06-06',
                                  style: TextStyle(
                                    color: RGBA.rgbaa6a6a6,
                                    fontSize: 12
                                  ),
                                ),
                              )
                            ],
                          ),
                          // right
                          Container(
                            width: 20,
                            height: 20,
                            child: Transform.scale(
                              scale: .8,
                              child: Checkbox(
                                activeColor: RGBA.rgba88afd5,
                                value: true,
                                onChanged: (flag) {},
                              ),
                            ),
                          )
                        ],
                      ),
                    ),
                  )
                ],
              ),
            ),
            Positioned(
              right: 15,
              bottom: 5,
              child: Container(
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.end,
                  children: <Widget>[
                    Text(
                      '使用规则',
                      style: TextStyle(
                        color: RGBA.rgbaa6a6a6,
                        fontSize: 10
                      ),
                    ),
                    icon0xe621(
                      color: RGBA.rgba999999
                    )
                  ],
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}